<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    if(isset($WebResults['SearchResponse']['Web']['Results'])){
        echo "<div id='WebResults'>" ;

        $i = 0; // incremental variable for search result numbering
        // foreach loop, to loop through each array value (result) as $res
        foreach ($WebResults['SearchResponse']['Web']['Results'] as $res) {
            $i++; // incrementation
            echo "<p>" . $i . ": <a href='" . $res['Url'] . "'>" . $res['Title'] . "</a><br /><i>" . $res['Description'] . "</i><br /><span style='font-size: 10pt;'>" . $res['DisplayUrl'] . "</span></p>"; // display everything
        }
        echo "<p><i>1-15 of " . $WebResults['SearchResponse']['Web']['Total'] . " results</i></p>"; // total number of results found by Bing for the search query provided
        echo  "</div>" ;

    }else{
        if(stristr ($WebResults[0] , "internet")) { echo "<p style=\"font-style:italic;font-style: bold  \">" ; echo  $WebResults[0] ; echo "</p>" ;}
        else
        echo "No Results Found for ";
    }
    if(isset($publicResults)&& is_array($publicResults)){
        echo "<div id='PublicResults'>" ;
        echo "<table id='publicSituationsResults' border=\"2\">";
        echo "<tr><th>Situation Name</th><th>Situation Description</th><th>Situation ID</th></tr>"  ;

        foreach ($publicResults  as $res) { // foreach loop, to loop through each array value (result) as $res
                $i = 0; // incremental variable for search result numbering
               

                //       echo $publicResults ;

                //            echo "<p><i>1-15 of " . $WebResults['SearchResponse']['Web']['Total'] . " results</i></p>"; // total number of results found by Bing for the search query provided

                $i++; // incrementation
                //      echo "<p>" . $i . ": <a href='" . "www.google.com" . "'>" . $res->name . "</a><br /><i>" . $res->description . "</i><br /><span style='font-size: 10pt;'>" . $res->id . "</span></p>"; // display everything
                echo "<tr>" ;
                echo "<td>" ;
                $b=base_url();
             
                echo "<a href=\"".base_url()."View/friendView/". $res->id ." \" >";         echo $res->name;    echo "</a>" ;
//                echo "<p onclick=\"javascript:window.location='". $b . "viewPageFriendC/index/$res->id'\" >";
//                echo $res->name;
//                echo "</p>" ;
//             
                echo "</td>" ;
                echo "<td>" ;
                if ($res->description == ""){
                    echo "-" ;
                }
                echo $res->description ;
                echo "</td>" ;
                echo "<td>" ;
                echo $res->id ;
                echo "</td>" ;
                echo "</tr>" ;
                

            }
            echo "</table>" ;
            echo  "</div>" ;
        }
        else{
            echo "No Public situation Results";
        }


?>


